package com.carl.bean;

import java.util.Date;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Indexed;
import com.google.code.morphia.utils.IndexDirection;

@Entity(noClassnameStored=true)
public class UserInfo {
	
	public static final int USER_IS_NO_EXIST = 0; //用户不存在
	public static final int USER_IS_EXIST = 1;	  //用户信息存在
	public static final int USER_NAME_VALID = 2;  //用户名无效
	public static final int USER_NAME_INVALID = 3;//有效的用户名
	
	public static final int USER_PASSWORD_IS_NULL = 4; //密码为空
	public static final int USER_PASSWORD_IS_VALID= 5; //密码有效
	
	public static final int USER_OPER_SUCCESS = 6;     //对用户信息的操作成功
	public static final int USER_OPER_ERROR = 7;

	@Id
	private ObjectId id;

	@Indexed(unique = true, value = IndexDirection.ASC)
	private String userName;
	private String password;
	private String role;
	private String subRole;
	private String email;
	private String phone;
	private int loginCount;
	private Date loginTime;

	private int isLock;
	private Date passTime;
	private int isOnline;
	private int status;

	public ObjectId getId() {
		return id;
	}

	public void setId(ObjectId id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public int getLoginCount() {
		return loginCount;
	}

	public void setLoginCount(int loginCount) {
		this.loginCount = loginCount;
	}

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public int getIsLock() {
		return isLock;
	}

	public void setIsLock(int isLock) {
		this.isLock = isLock;
	}

	public Date getPassTime() {
		return passTime;
	}

	public void setPassTime(Date passTime) {
		this.passTime = passTime;
	}

	public int getIsOnline() {
		return isOnline;
	}

	public void setIsOnline(int isOnline) {
		this.isOnline = isOnline;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getSubRole() {
		return subRole;
	}

	public void setSubRole(String subRole) {
		this.subRole = subRole;
	}
}
